import Taro, { Component } from '@tarojs/taro'
import { View, Button } from '@tarojs/components'
import Base from '@/components/Base'

class Index extends Component {
  state = {}

  getUserInfo(userInfo) {
    console.log(e)
    console.log('userinfo', userInfo)
    if (userInfo.detail.userInfo) {
      //同意
    } else {
      //拒绝,保持当前页面，直到同意
    }
  }

  render() {
    // const { openType, key } = this.props
    return (
      <Base>
        <Text>申请获取你的公开信息（昵称、头像等）</Text>
        <Button open-type="getUserInfo" onGetUserInfo={this.getUserInfo}>微信授权</Button>
      </Base>
    )
  }
}
export default Index
